<template>
  <div>
    <HeaderBar></HeaderBar>
    <CardItem :item="detailItem"></CardItem>
  </div>
</template>

<script>
import { mapActions, mapState } from 'vuex'
import CardItem from '../components/CardItem.vue'
import HeaderBar from '../components/HeaderBar.vue'
export default {
  components: { CardItem, HeaderBar },
  computed: {
    ...mapState(['detailItem']),
  },
  created() {
    if (this.$route.params.id) {
      this.detailFunc({ id: this.$route.params.id })
    }
  },
  methods: {
    ...mapActions(['detailFunc']),
  },
}
</script>

<style></style>
